package cn.cxyxj.code_auth_jwt_persistence_prod.mapper;

import cn.cxyxj.code_auth_jwt_persistence_prod.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * 系统角色表 Mapper 接口
 * @author cxyxj
 * @since 2022-11-03
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {


    @Select("SELECT sr.id,sr.role_name FROM `sys_user_role_middle` surm LEFT JOIN  sys_role sr on surm.role_id = sr" +
            ".id where surm.user_id = #{userId}")
    List<SysRole> selectByUserId(Integer id);

}

